#ifndef WIDGET_H
#define WIDGET_H

#include <QOpenGLWidget>
#include <QDebug>
#include <QOpenGLFunctions_3_3_Core>
#include "shader.h"
#include <QOpenGLTexture>
#include <QTime>    //增添头文件
#include <QVector3D>

class Triangle : public QOpenGLWidget
{
public:
    Triangle();
    GLuint a;
    ~Triangle();
protected:
    virtual void initializeGL();
    virtual void resizeGL(int w, int h);
    virtual void paintGL();
    void keyPressEvent(QKeyEvent *event);

private:
    Shader *ourShader;
    QOpenGLTexture *texture1;
    QOpenGLTexture *texture2;

    QOpenGLFunctions_3_3_Core *core;
    QTime time; //增添QTime对象，替代glfwGetTime()函数

    QVector3D cameraPos;
    QVector3D cameraFront;
    QVector3D cameraUp;
    GLfloat deltaTime;
    GLfloat lastFrame;
};

#endif // WIDGET_H
